package com.lichao.FinkDataProcess.rel;

import com.alibaba.fastjson.JSONObject;
import com.lichao.FinkDataProcess.compare.CompareNode;


/**
 * @author: li chao
 * @Desc:
 * @create: 2024-11-15 21:11
 **/
public class OrNode extends RelNode {

    public OrNode() {
        init();
    }

    @Override
    public boolean apply(JSONObject json) throws Exception {
        for (Node node : getChildNodes()) {
            if (((CompareNode) node).compare(json) || (node instanceof RelNode && ((RelNode) node).apply(json))) {
                return true;
            }
        }
        return false;
    }
}
